<nz-spin [nzSpinning]="isSpinning">
  <nz-collapseset>
    <nz-collapse [nzTitle]="'选取项目'" [nzActive]="true" [nzDisabled]="false">
        <div nz-row>
          <div nz-col [nzSpan]="12">
            <nz-select style="width: 100%;" [nzPlaceHolder]="'请选择项目'" nzAllowClear [nzMode]="'multiple'" [(ngModel)]="programs">
              <nz-option *ngFor="let option of programList" [nzLabel]="option" [nzValue]="option" 
              [nzDisabled]="option.disabled"></nz-option>
            </nz-select>
          </div>
        </div>
    </nz-collapse>
  </nz-collapseset>
  <nz-collapseset>
      <nz-collapse [nzTitle]="'选取任务执行者'" [nzActive]="true" [nzDisabled]="false">
  <div nz-row [nzGutter]="8" *ngIf="this.planDetailBean.checkType=='1'">
    <div nz-col class="gutter-row" [nzSpan]="6">
      <nz-select style="width: 100%;" [nzPlaceHolder]="'请选择机构类型'"  [(ngModel)]="partyType">
          <nz-option [nzLabel]="'检测单位'" [nzValue]="3">
          </nz-option>
          <nz-option [nzLabel]="'监管单位'" [nzValue]="4">
          </nz-option>
      </nz-select>
    </div>
    <div nz-col class="gutter-row" [nzSpan]="6">
      <button nz-button [nzType]="'primary'" (click)="query()">
        <span>查询</span>
      </button>
    </div>
  </div>

  <nz-table *ngIf="this.planDetailBean.checkType=='1'" #nzTable [nzDataSource]="list" nzSize="middle" [nzBordered]="true" [nzIsPagination]="false" (nzDataChange)="displayDataChange($event)">
      <thead nz-thead>
        <tr>
          <th nz-th [nzCheckbox]="true">
            <label nz-checkbox [(ngModel)]="allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)">
            </label>
          </th>
          <th nz-th>
            <span>单位名称</span>
          </th>

          <th nz-th>
            <span>单位类型</span>
          </th>
        </tr>
      </thead>
      <tbody nz-tbody>
        <tr nz-tbody-tr *ngFor="let data of list">
          <td nz-td [nzCheckbox]="true">
            <label nz-checkbox [nzDisabled]="data.disabled" [(ngModel)]="data.checked" (ngModelChange)="refreshStatus($event)">
            </label>
          </td>
          <td nz-td>{{data.partyName}}</td>

          <td nz-td>{{data.partyType | partyType}}</td>
        </tr>
      </tbody>
    </nz-table>

<nz-table *ngIf="this.planDetailBean.checkType=='2'" #nzTable [nzDataSource]="list" nzSize="middle" [nzBordered]="true" [nzIsPagination]="false" (nzDataChange)="displayDataChange($event)">
    <thead nz-thead>
      <tr>
        <th nz-th [nzCheckbox]="true">
          <label nz-checkbox [(ngModel)]="allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)">
          </label>
        </th>
        <th nz-th>
          <span>姓名</span>
        </th>
        <th nz-th>
          <span>账号</span>
        </th>
        <th nz-th>
          <span>工号</span>
        </th>
        <th nz-th>
          <span>证书号码</span>
        </th>
        <th nz-th>
          <span>持证类型</span>
        </th>
        <th nz-th>
          <span>所在单位</span>
        </th>
        <th nz-th>
          <span>账号状态</span>
        </th>
      </tr>
    </thead>
    <tbody nz-tbody>
      <tr nz-tbody-tr *ngFor="let data of list">
        <td nz-td [nzCheckbox]="true">
          <label nz-checkbox [nzDisabled]="data.disabled" [(ngModel)]="data.checked" (ngModelChange)="refreshStatus($event)">
          </label>
        </td>
        <td nz-td>{{data.userName}}</td>
        <td nz-td>{{data.userCode}}</td>
        <td nz-td>{{data.workNumber}}</td>
        <td nz-td>{{data.cardTypeNumber}}</td>
        <td nz-td>{{data.cardType}}</td>
        <td nz-td>{{data.partyName}}</td>
        <td nz-td>{{data.userState | constantTransfer:userState}}</td>
      </tr>
    </tbody>
  </nz-table>

  <nz-pagination [nzPageIndex]="userBean.currentPage" nzShowTotal [nzTotal]="total" nzShowSizeChanger (nzPageSizeChange)="nzPageSizeChange($event)"
    (nzPageIndexChange)="nzPageIndexChange($event)" (nzPageIndexClickChange)="nzPageIndexClickChange($event)" [nzPageSize]="userBean.pageSize"></nz-pagination>
  </nz-collapse>
  </nz-collapseset>


  <form nz-form [formGroup]="validateForm" >
    <div nz-form-item nz-row style="margin-bottom:8px;">
      <div nz-form-control nz-col [nzSpan]="14" [nzOffset]="10">
        <button nz-button [nzSize]="'large'" (click)="submitForm($event)" [nzType]="'primary'">确定</button>
      </div>
    </div>
  </form>
</nz-spin>
